from langchain.chains import LLMChain
from langchain.prompts import PromptTemplate
from modelscope import Tasks

from ModelScopeSpeechLLM import ModelScopeSpeechLLM

# 创建一个简单的提示模板
prompt = PromptTemplate(template="Processing audio file at: {audio_path}", input_variables=["audio_path"])

speech_llm = ModelScopeSpeechLLM(task=Tasks.speech_separation, model_id='damo/speech_mossformer2_separation_temporal_8k')

# 创建 LLMChain 使用自定义的 ModelScope 语音 LLM
chain = LLMChain(llm=speech_llm, prompt=prompt)

# 运行链式工作流，传入音频路径
result = chain.run(audio_path='path/to/your/audio.wav')  # 替换为实际的音频文件路径
print(result)
